package xyz.xtt.pay.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author dale
 * @since 2024/12/30
 **/
@Schema(description = "统一支付回调参数")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PayCallbackMessage {
    @Schema(description = "通通用户id")
    private String userId;
    @Schema(description = "订单类型")
    private String orderType;
    @Schema(description = "订单号")
    private String orderNo;
    @Schema(description = "第三方交易订单号")
    private String thirdTradeNo;
    @Schema(description = "款银行 银行类型，采用字符串类型的银行标识")
    private String bankType;
    @Schema(description = "交易流水号")
    private String tradeNo;
    @Schema(description = "是否有退款(0-否;1-是)")
    private Integer isRefund;
    @Schema(description = "微信支付：210；美付宝支付：220;宝付支付：240")
    private Integer payMode;
    @Schema(description = "微信APP支付：210001；美付宝APP支付：220001；宝付支付：240001")
    private Integer payModeSub;
    @Schema(description = "下单参数")
    private CallbackParam payNotify;
    @Schema(description = "回调参数")
    private CallbackParam callbackParams;

    @Schema(description = "统一支付回调参数详情")
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class CallbackParam{
        @Schema(description = "交易流水号")
        private String transaction_id;
        @Schema(description = "随机字符串")
        private String nonce_str;
        @Schema(description = "付款银行 银行类型，采用字符串类型的银行标识")
        private String bank_type;
        @Schema(description = "")
        private String openid;
        @Schema(description = "货币种类")
        private String fee_type;
        @Schema(description = "app支付商户号")
        private String mch_id;
        @Schema(description = "现金支付金额")
        private Long cash_fee;
        @Schema(description = "商户订单号")
        private String out_trade_no;
        @Schema(description = "app支付appid")
        private String appid;
        @Schema(description = "订单金额.(订单总金额，单位为分)")
        private Long total_fee;
        @Schema(description = "交易类型(JSAPI、NATIVE、APP)")
        private String trade_type;
        @Schema(description = "返回状态码")
        private String result_code;
        @Schema(description = "附加信息")
        private String attach;
        @Schema(description = "支付完成时间")
        private String time_end;
        @Schema(description = "是否关注公众账号")
        private String is_subscribe;
        @Schema(description = "返回状态码")
        private String return_code;
    }
}
